<script>
export default {
/**
 * @params size：大小
 * @params type: 颜色
 * @params light: 简约
 * @params circle: 圆形
 * @params disabled: 禁用
 * @params msg: 消息
 */
  name: 'gsbadge',
  props:{
    size:String,
    type:String,
    light:Boolean,
    circle:Boolean,
    disabled:Boolean,
    msg:String
  },
  data(){
    return {
    }
  },
  render: function (h) {
    let cls = 'gs-badge';
    this.size ? cls = cls + ' gs-badge--' + this.size :''
    this.type ? cls = cls + ' gs-badge--' + this.type :''
    this.disabled ? cls = cls + ' gs-badge--' + this.disabled :''
    this.light ? cls = cls + ' gs-badge--light':''
    this.circle ? cls = cls + ' gs-badge--circle'  :''
    // this.msg ? cls = cls + ' gs-badge--msgbtn'  :''
    if(this.msg){
      return h('div',{class:"gs-badge--msg"},
        [h('div',{class:'gs-badge--msgdiv'},this.msg),
          h('button',{class:cls},this.$slots.default)
        ]
      )
    }else{
      return h('button',{class:cls},this.$slots.default)
    }
    
  },
  methods:{
    click(){
      this.$emit("click",arguments)
    },
  },
}
</script>